<?php 
$link = mysqli_connect('localhost', 'xuser', 'x123456') or die(mysqli_connect_error($link));
$res = mysqli_query($link, "SHOW DATABASES;");

while ($row = mysqli_fetch_assoc($res)) {
        echo $row['Database'] . "\n";
}
/* 
[root@192-168-31-102 ~]# php mysqli_test.php
information_schema
foodb
mysql
performance_schema
test
xdb
*/
?>
